import request from '@/utils/request'

// 查询药房列表
export function listPharmacy(query) {
  return request({
    url: '/medicine/pharmacy/list',
    method: 'get',
    params: query
  })
}

// 查询药房详细
export function getPharmacy(id) {
  return request({
    url: '/medicine/pharmacy/getPharmacyById',
    method: 'get',
    params: {
      id
    }
  })
}

// 新增药房
export function addPharmacy(data) {
  return request({
    url: '/medicine/pharmacy/add',
    method: 'post',
    data: data
  })
}

// 修改药房
export function updatePharmacy(data) {
  return request({
    url: '/medicine/pharmacy/update',
    method: 'post',
    data: data
  })
}

// 删除药房
export function delPharmacy(ids) {
  return request({
    url: '/medicine/pharmacy/batchDelete',
    method: 'post',
    params: {
      ids
    }
  })
}

export function allPharmacyList() {
  return request({
    url: '/medicine/pharmacy/allList',
    method: 'get'
  })
}
